from base.myBase import Tools


class login_model(Tools):
    # 定义登录路径
    login_path = '/user/login'

    # 发送登录请求
    def login_action(self, usr, pwd, check='1234'):
        mydata = {
            'username': usr,
            'password': pwd,
            'checkcode': check
        }
        res = self.session.post(url=self.hosturl+self.login_path, data=mydata)
        return res.json()
